<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js</title>

    <!-- <script>
        //alert("000");
        let div2 = document.getElementById("outer");
        alert(div2);//null
    </script> -->
</head>
<body>

    <div id="outer"></div>
    

    <!-- 引用外部js , 那么标签体中就不要再去写js代码了. -->
    <script src="js/outer.js"></script>

    <!-- 内部js - 推荐放在body的底部 -->
    <script>
        //alert("111");
        let div = document.getElementById("outer");
        alert(div);
    </script>
</body>
</html>